import type { ISchema } from '@/pages/order-record/component/basic-data/types'
import type { PlusColumn } from 'plus-pro-components'

export function useBasicData() {
    const GENDER = [
        {
            label: '男',
            value: 0,
        },
        {
            label: '女',
            value: 1,
        },

    ]
    const columns: PlusColumn[] = [
        {
            colProps: {
                span: 12,
            },
            label: '会员姓名',
            prop: 'realName',
            // tooltip: '名称最多显示6个字符',
            valueType: 'copy',
            width: 120,
        },
        {
            colProps: {
                span: 12,
            },
            label: '联系方式',
            prop: 'mobile',
            valueType: 'copy',
        },
        {
            label: '会员性别',
            options: GENDER,
            prop: 'gender',
            valueType: 'radio',
        },
        {
            colProps: {
                span: 12,
            },
            label: '会员年龄',
            prop: 'age',
            valueType: 'copy',
        },
        {
            colProps: {
                span: 12,
            },
            label: '身份证号',
            prop: 'idCardNo',
            valueType: 'copy',
        },
        {
            colProps: {
                span: 12,
            },
            label: '微信号',
            prop: 'wechat',
            valueType: 'copy',
        },
        {
            colProps: {
                span: 12,
            },
            label: '常用收货人',
            prop: 'consignee',
            valueType: 'copy',
        },
        {
            colProps: {
                span: 12,
            },
            label: '详细地址',
            prop: 'detailedAddress',
            valueType: 'copy',
        },
    ]

    const rules = {
        // name: [
        //     {
        //         message: '请输入名称',
        //         required: true,
        //     },
        // ],
    }
    const schema: ISchema[] = [
        { key: 'realName', label: '会员姓名' },
        { key: 'mobile', label: '会员手机' },
        { key: 'objectId', label: '用户ID' },
        { key: 'nickName', label: '昵称' },
        { key: 'age', label: '会员年龄' },
        { key: 'wechat', label: '微信号' },
        { key: 'gender', label: '会员性别', options: GENDER },
        { key: 'consignee', label: '常用收货人' },
        { key: 'detailedAddress', label: '详细地址' },
        { key: 'idCardNo', label: '身份证号' },
        { key: 'registerDateTime', label: '注册时间' },
        { key: 'lastLoginDateTime', label: '最近登录时间' },
        { key: 'source', label: '来源方式' },
    ]

    return {
        columns,
        rules,
        schema,
    }
}
